<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>登录 - 获取授权码</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f0f0f0;
            padding: 20px;
            background-image: url("1.jpg");  /* 添加这行来引入背景图 */
            background-size: cover;  /* 使背景图充满整个容器 */
            background-repeat: no-repeat;  /* 不要重复背景图 */
        }

        h1 {
            color: #333;
            text-align: center;
        }

        h2 {
            color: #1a1515;
            margin-top: 30px;
            text-align: center;
        }

        form {
            display: inline-block;
            margin-top: 20px;
        }

        button {
            padding: 10px 20px;
            font-size: 16px;
            color: white;
            background-color: #007BFF;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }

        button:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<%
    Cookie[] cookies = request.getCookies();
    String username = null;
    if (cookies != null) {
        for (jakarta.servlet.http.Cookie cookie : cookies) {
            if (cookie.getName().equals("username")) {
                username = cookie.getValue();
            }
        }
    }
%>
<body>
<h1>欢迎用户：<%= username%></h1>
<h2>获取授权码</h2>
<div align="center">
    <form action="au.jsp" method="get">
        <input type="hidden" name="type" value="free">
        <button type="submit" id="getFree">获取免费授权码</button>
    </form>
    <form action="au.jsp" method="get">
        <input type="hidden" name="type" value="39">
        <button type="submit" id="get39">获取39元授权码</button>
    </form>
    <form action="au.jsp" method="get">
        <input type="hidden" name="type" value="99">
        <button type="submit" id="get99">获取99元授权码</button>
    </form>
    <br>
    <form action="useau.jsp" method="get">
        <button type="submit" > 使用授权码</button>
    </form>

</div>
</body>
</html>